import request from '@/utils/request'

export function findList(data) {
    return request({
        url: '/advertising',
        method: 'get',
        params: data,
    })
}
export function save(data) {
    if(data.id ==null){
        return request({
            url: '/advertising',
            method: 'post',
            data: data,
        })
    }else{
        return request({
            url: '/advertising/'+data.id,
            method: 'put',
            data: data,
        })
    }
}
export function findDetail(id) {
    return request({
        url: '/advertising/'+id,
        method: 'get',
    })
}
export function deleted(id) {
    return request({
        url: '/advertising/'+id,
        method: 'delete',
    })
}
//改变上下架状态
export function changeStatus(id,status) {
    return request({
        url: '/advertising/changeStatus/'+id,
        method: 'put',
        params:{'status':status}
    })
}